package exception;

import java.util.Scanner;

/**
 * @author げっしょく
 * @date 2021/7/24
 */
public class Test3 {
    public static void main(String[] args) {
        System.out.println("输入你的年龄");
        Scanner sc = new Scanner(System.in);
        int age = sc.nextInt();
        panduan(age);
        System.out.println("你的年龄"+ age);
    }

    private static void panduan(int age) {
        if (age > 130 || age < 0) {
            throw new AgeOutOfBoundsException("你的年龄超出范围"+ age);
        }
    }
}
